package com.x.control;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.x.model.Role;
import com.x.service.transactional.RoleService;

@Controller
@RequestMapping("/role")
public class RoleController {

	@Autowired(required = true)
	RoleService roleService;

	@RequestMapping(value = "/list")
	@ResponseBody
	public List<Role> list() {
		List<Role> Roles = roleService.list();
		for (Role role : Roles) {
			role.setUsers(null);
		}
		return Roles;
	}
}
